package com.erp.notifiactionDb;

import org.xutils.DbManager;

/**
 * Created by Administrator on 2016/12/21/021.
 * 作者：刘洋
 */
public class DatabaseOpenHelper {
    private DbManager.DaoConfig daoConfig;
    public DatabaseOpenHelper(String name,int version) {
        daoConfig = new DbManager.DaoConfig()
                .setDbName(name)
                .setDbVersion(version)
                .setDbUpgradeListener(new DbManager.DbUpgradeListener() {
                    @Override
                    public void onUpgrade(DbManager db, int oldVersion, int newVersion) {
                        //数据库升级操作
                    }
                });
    }
    public DbManager.DaoConfig getDaoConfig(){
        return daoConfig;
    }
}
//    PersonDB personDB = new PersonDB();
//    Person person1 = new Person("jay",20);
//    Person person2 = new Person("wang",40);
//personDB.savePerson(person1);
//        personDB.savePerson(person2);
//        List<Person> list = personDB.loadPerson();
//        if (list!=null) {
//        for (Person person : list) {
//        Log.d("xyz", person.toString());
//        }
//        }